<!-- 组件说明 -->
<template>
  <div class="inviterecordWrap">
    <goback :title="'RECORD'" :ifTransparent="false"></goback>
    <div class="container clearfix">
      <div class="li" v-for="(item, index) in listArr" :key="index">
        <div class="left">
          <img :src="item.headerpic ? item.headerpic : defaultPic" alt="" />
          <div class="other">
            <p>{{ item.nickName }}</p>
            <!--            <span>ID:{{ item.id }}}</span>-->
          </div>
          <!--          <div class="other">-->
          <!--            <p>{{ item.nickName }}</p>-->
          <!--            <span>ID:{{ item.id }}}</span>-->
          <!--          </div>-->
        </div>
        <div class="right">{{ item.createTime }}</div>
      </div>
      <p class="nomore" v-if="!ifLoading">No More</p>
    </div>
  </div>
</template>

<script>
import { ifLogin, utilGotoLogin } from "@/utils/index.js";
import { mapState } from "vuex";

export default {
  components: {},
  name: "percenterInviteRecord",
  data() {
    return {
      defaultPic: require("@/assets/imgs/index/defaultPic.png"),
      listArr: [],
      ifLoading: false
    };
  },
  computed: mapState({
    // 箭头函数可使代码更简练
    userStoreData: state => state.user
  }),
  methods: {
    pageinit() {
      let zs = this;
      this.$toast.loading({
        duration: 0,
        forbidClick: true
      });
      this.ifLoading = true;
      this.api.userController
        .userObtainUserInviterelationship({
          userId: zs.userStoreData.userId,
          currPage: 1,
          pageSize: 100000
        })
        .then(res => {
          this.ifLoading = false;
          zs.$toast.clear();
          if (res.data.code == 200) {
            zs.listArr = res.data.data.list;
          } else {
            zs.$toast(res.data.info);
          }
        });
    }
  },
  mounted() {
    this.pageinit();
  },
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {} //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>

<style lang="less" scoped>
@import url("./../../../assets/css/common.less");
.inviterecordWrap {
  color: #000;
  padding-top: 1.44rem;
  .container {
    padding: 0 0.3rem;
    .li {
      padding: 0.2rem 0 0.14rem;
      border-bottom: 1px solid rgba(204, 204, 204, 1);
      display: flex;
      justify-content: space-between;
      &:first-child {
        padding-top: 0;
      }
      .left {
        display: flex;
        img {
          width: 0.8rem;
          height: 0.8rem;
          border-radius: 50%;
          overflow: hidden;
        }
        .other {
          padding-left: 0.2rem;
          //p,
          //span {
          //  display: block;
          //  height: 0.4rem;
          //  line-height: 0.4rem;
          //  font-size: 0.28rem;
          //
          //  font-weight: bold;
          //  color: #333333;
          //  opacity: 1;
          //  text-align: left;
          //}
          p {
            display: block;
            height: 0.8rem;
            line-height: 0.8rem;
            font-size: 0.28rem;

            font-weight: bold;
            color: #333333;
            opacity: 1;
            text-align: left;
          }
        }
      }
      .right {
        padding: 0.46rem 0 0.06rem;
        height: 0.28rem;
        line-height: 0.28rem;
        font-size: 0.2rem;

        font-weight: normal;
        color: #999999;
        opacity: 1;
      }
    }
    .nomore {
      height: 0.28rem;
      font-size: 0.2rem;
      font-weight: normal;
      line-height: 0.28rem;
      color: #999999;
      opacity: 1;
      display: block;
      text-align: center;
      padding: 0.1rem 0 0;
    }
  }
}
</style>
